<style type="text/css" title="currentStyle">
	@import "../media/css/demo_page.css";
	@import "../media/css/demo_table_jui.css";
	@import "../examples_support/themes/smoothness/jquery-ui-1.8.4.custom.css";
	@import "media/css/TableTools_JUI.css";
</style>
<script type="text/javascript" charset="utf-8" src="../media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="media/js/ZeroClipboard.js"></script>
<script type="text/javascript" charset="utf-8" src="media/js/TableTools.js"></script>
<script type="text/javascript" charset="utf-8">
	$(document).ready( function () {
		$('#example').dataTable( {
			"bJQueryUI": true,
			"sPaginationType": "full_numbers",
			"sDom": 'Tlfrtip',	
			"oTableTools": {
				"aButtons": [
					"copy", "csv", "xls", "pdf", "print",
					{
						"sExtends":    "collection",
						"sButtonText": "Save",
						"aButtons":    [ "csv", "xls", "pdf" ]
					}
				]
			}
		} );
	} );
</script>

<?php
/*if(!isset($_POST[txtClientType]))
	$_POST[txtClientType] = 'Reseller';*/
//print_r($_POST);

$sql = "SELECT * FROM tb_clientinfo WHERE ci_clientType='Reseller' AND ci_clientId=".$_SESSION[clientID]." ORDER BY ci_clientName ASC";
$rows = $db->query($sql);

?>
<script language="javascript">
function callDiffClient(clientType)
{
	document.frmClientType.txtClientType.value = clientType;
	document.frmClientType.submit();
}
function funEditUser(uid,act)
{
	document.frmSubmit.txtClientId.value = uid;
	document.frmSubmit.action = act;
	document.frmSubmit.submit();
}
</script>

<div align="left" class="listofusers">&nbsp;<a href="#" onclick="location.href='?ch=addReseller';">Add New</a></div>
<table cellpadding="0" cellspacing="0" border="0" class="gridform_final" id="example">      
	<thead>
    <tr>
		<th width="5%">#</th>
        <th width="15%">Reseller Name   </th>
        <th width="15%">Land Line</th> 
        <th width="15%">Mobile </th>
        <th width="17%">Email 1</th>
        <th width="17%">Email 2</th>
        <th width="10%">C. Date</th>
        <th width="17%">Subs.</th>
        <th width="15%">Edit</th>
   </tr>
   </thead>
   <tbody>
   <?php
   if($db->affected_rows > 0)
   {
   $i = 1;
   	while ($record = $db->fetch_array($rows)) 
	{
	?>
	<tr>
		<td><?php echo $i;?></td>
        <td><?php echo ucfirst($record[ci_clientName]);?></td>
        <td><?php echo $record[ci_phoneNumber];?> </td>
        <td><?php echo $record[ci_mobileNumer];?> </td>
        <td><?php echo $record[ci_email1];?> </td>
        <td><?php echo $record[ci_email2];?> </td>
        <td><?php echo date("d-m-Y",strtotime($record[ci_createdDate])) ;?> </td>
        <td><!--<a href="#" onclick="funEditUser('<?php echo $record[ci_id];?>','?ch=addResellerSubscription')">Add</a></span> / --><a href="#" onclick="funEditUser('<?php echo $record[ci_id];?>','?ch=viewResellerSubscription')">view </a></span></td>
        <td><img src="../../images/edit.gif" style="cursor:pointer;" width="45" height="16" border="0" onclick="funEditUser('<?php echo $record[ci_id];?>','?ch=addReseller')" /></td>
   </tr>
   <?php
   $i++;
   	//$avail = 0;
   //}
	}
	}
   ?>
   </tbody>
</table>
<form name="frmSubmit" id="frmSubmit" method="post">
	<input type="hidden" name="txtClientId" id="txtClientId" />
</form>
<form name="frmClientType" id="frmClientType" method="post">
	<input type="hidden" name="txtClientType" id="txtClientType" />
</form>